package com.kaishengit.pojo;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name="t_contact")
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class Contact {
	private String id;
	private String name;
	private String position;
	private String qqroom;
	private String background;
	private String createtime;
	private String views;
	private String type;
	private String cid;
	private User user;
	private List<Address> addresslist;
	private List<Email> emaillist;
	private List<IM> imlist;
	private List<Phone> phonelist;
	private List<Website> websitelist;
	private List<Tag> tagList;
	private List<Note> noteList;
	private String company;
	private List<Deal> deallist;
	private List<String> viewname;
	
	@Id
	@GenericGenerator(name="idGenerator" , strategy="uuid")
	@GeneratedValue(generator="idGenerator") 
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getCid() {
		return cid;
	}
	public void setCid(String cid) {
		this.cid = cid;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPosition() {
		return position;
	}
	public void setPosition(String position) {
		this.position = position;
	}
	public String getQqroom() {
		return qqroom;
	}
	public String getBackground() {
		return background;
	}
	public void setBackground(String background) {
		this.background = background;
	}
	public void setQqroom(String qqroom) {
		this.qqroom = qqroom;
	}
	public String getCreatetime() {
		return createtime;
	}
	public void setCreatetime(String createtime) {
		this.createtime = createtime;
	}
	public String getViews() {
		return views;
	}
	public void setViews(String views) {
		this.views = views;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	@ManyToOne
	@JoinColumn(name="userid")
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	
	@OneToMany(mappedBy="contact",cascade={CascadeType.REMOVE})
	public List<Address> getAddresslist() {
		return addresslist;
	}
	public void setAddresslist(List<Address> addresslist) {
		this.addresslist = addresslist;
	}
	
	@OneToMany(mappedBy="contact",cascade={CascadeType.REMOVE})
	public List<Email> getEmaillist() {
		return emaillist;
	}
	public void setEmaillist(List<Email> emaillist) {
		this.emaillist = emaillist;
	}
	
	@OneToMany(mappedBy="contact",cascade={CascadeType.REMOVE})
	public List<IM> getImlist() {
		return imlist;
	}
	public void setImlist(List<IM> imlist) {
		this.imlist = imlist;
	}
	
	@OneToMany(mappedBy="contact",cascade={CascadeType.REMOVE})
	public List<Phone> getPhonelist() {
		return phonelist;
	}
	public void setPhonelist(List<Phone> phonelist) {
		this.phonelist = phonelist;
	}
	
	@OneToMany(mappedBy="contact",cascade={CascadeType.REMOVE})
	public List<Website> getWebsitelist() {
		return websitelist;
	}
	public void setWebsitelist(List<Website> websitelist) {
		this.websitelist = websitelist;
	}
	
	@OneToMany(mappedBy="contact",cascade={CascadeType.REMOVE})
	public List<Tag> getTagList() {
		return tagList;
	}
	public void setTagList(List<Tag> tagList) {
		this.tagList = tagList;
	}
	
	@OneToMany(mappedBy="contact",cascade={CascadeType.REMOVE})
	public List<Deal> getDeallist() {
		return deallist;
	}
	public void setDeallist(List<Deal> deallist) {
		this.deallist = deallist;
	}
	
	@Transient
	public String getCompany() {
		return company;
	}
	public void setCompany(String company) {
		this.company = company;
	}
	
	@Transient
	public List<Note> getNoteList() {
		return noteList;
	}
	public void setNoteList(List<Note> noteList) {
		this.noteList = noteList;
	}
	
	@Transient
	public List<String> getViewname() {
		return viewname;
	}
	public void setViewname(List<String> viewname) {
		this.viewname = viewname;
	}
	
	
	
}
